const path = require('path')

module.exports = {
    mode: 'development',
    entry: {
        main: './src/index.js'
    },
    resolveLoader: {
        modules: ['node_modules', './loader']
    },
    module: {
        rules: [
            {
                test: /\.js/,
                use: [
                    // path.resolve(__dirname, './loader/replaceLoader.js')
                    // {
                    //     loader: path.resolve(__dirname, './loader/replaceLoader.js'),
                    //     options: {
                    //         name: 'webpack'
                    //     }
                    // }
                    path.resolve(__dirname, './loader/replaceLoader.js'),
                    {
                        loader: path.resolve(__dirname, './loader/replaceLoaderAsync.js'),
                        options: {
                            name: 'webpack'
                        }
                    }
                ]
            }
        ]
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: '[name].js'
    }
}